#pragma once

#include "fxcc/core/graph/common/pch.h"
#include "fxcc/core/graph/common/Type.h"
#include "fxcc/core/graph/common/TypeDesc.h"
#include "fxcc/core/graph/common/MaterialView.h"

namespace fxcc
{
    namespace graph
    {
        namespace common
        {
            struct FXCC_API     SamplerTypeDesc
            {
                std::string m_Name{"undefined"};
                SamplerType m_Type{ SamplerType::_sampler_2d_default_ };
                SamplerTypeDesc() {

                }
                SamplerTypeDesc(const std::string n, const SamplerType& type) :m_Name(n), m_Type(type)
                {}
            };

            struct FXCC_API     Texture2DDescTypeDesc
            {
                std::string m_Name;
                
                Texture2DDescType m_Value;

                Texture2DDescTypeDesc() = default;

                Texture2DDescTypeDesc(const std::string& name, const Texture2DDescType& value) :m_Name(name), m_Value(value)
                {

                }
            };

            struct FXCC_API  RenderStates
            {

                std::vector<fxcc::graph::common::TextureMatTypeDesc> m_TextureMatDescs;

                std::vector<SamplerTypeDesc> m_SamplerDescs;

                std::vector<Texture2DDescTypeDesc> m_Texture2DDescTypeDescs;

                bool Init();

                bool InitTextureMatType();

                bool InitSamplerDesc();

                bool InitTexture2DDescTypeDesc();

                bool InitCubeMapDescs();

                TextureMatTypeDesc GetTextureMatDesc(const TextureMatType& type);

                std::array<std::string, 6> CubeFaceName;

                glm::mat4 captureProjection;

                std::array<glm::mat4, 6> captureViews;

                static RenderStates& Inst()
                {
                    static RenderStates res;
                    return res;

                }
            };
        }
    }
};